<template>
	<view class="bg-white">
		<view class="title">
			欢迎来到代理端
		</view>
		<view class="proxy-main">
			<view class="router-ul">
				<view class="router-li" v-for="(val,inx) in routerLi" :key="inx" @click="torouter(val.value)">
					<!-- <span class="router-img"></span> -->
					<image class="router-img" :src="val.url" mode=""></image>
					<span style="margin-top: 10rpx;">{{val.name}}</span>
				</view>
			</view>
			<view class="banner">
				<view class="baner-money">
					<view class="b-n-1">
						<span class="account-name">账户余额/元</span>
						<span class="account-value">248.00</span>
					</view>
					<view class="b-n-2">
						<span class="wal-btn" @click="withdrawalRot">提现</span>
					</view>
				</view>
				<view class="baner-income" style="color:#fff">
					<view class="banner-left" style="align-items: flex-start;">
						<span class="baner-value">2000</span>
						<span class="banner-name">最终收益</span>
					</view>
					<view class="banner-left" style="align-items: flex-end;">
						<span class="baner-value">2000</span>
						<span class="banner-name">总收益</span>
					</view>
				</view>
			</view>

			<view class="banner2" style="background-color: #fff;">
				<view class="banner-left">
					<span class="baner-value">2000</span>
					<span class="banner-name">本月团队新增人数</span>
				</view>
				<view class="banner-left">
					<span class="baner-value">2000</span>
					<span class="banner-name">总人数</span>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import api from 'utils/api'
	const app = getApp();
	export default {

		data() {
			return {
				routerLi: [{
						name: '悦居卡',
						url: 'http://static.qlzc.net/1895408479469047808/material/bf4a8c55-8cbf-440c-81cb-eb86d7b3afcb.png',
						value: 1
					},
					{
						name: '收益明细',
						url: 'http://static.qlzc.net/1895408479469047808/material/e145fb5e-4332-453d-a87a-399cc449c1f4.png',
						value: 2
					},
					{
						name: '提现',
						url: 'http://static.qlzc.net/1895408479469047808/material/1a15a257-bd39-4107-898c-4874112a498e.png',
						value: 3
					},
					{
						name: '用户',
						url: 'http://static.qlzc.net/1895408479469047808/material/e5b6eba6-6a1a-45d3-9db6-e940ff82660b.png',
						value: 4
					}
				]
			};
		},
		onLoad(e) {
			console.log(1111);
			api.indexTotal()
		},


		methods: {
			torouter(val) {
				console.log(val);
				if (val == 1) {
					uni.navigateTo({
						url: '/pages/lotteryTicket/index'
					});
				} else if (val == 2) {
					uni.navigateTo({
						url: '/pages/yuejCard/index'
					});
				}
			},
			withdrawalRot() {
				uni.navigateTo({
					url: '/pages/withdrawal/index'
				});
			},
			// aaa(){
			// 	api.indexTotal()
			// }
		}
	}
</script>

<style lang="scss" scoped>
	.bg-white {
		width: 100%;
		height: 100vh;
		background-color: #fff;
		position: relative;
		background-color: #ddd;

		.title {
			width: 100%;
			height: 300rpx;
			background-color: #2896ff;
			padding: 20rpx;
			padding-top: 120rpx;
			box-sizing: border-box;
			border-radius: 0 0rpx 15rpx 15rpx;
			color: #fff;
		}
	}

	.proxy-main {
		width: 90%;
		height: 80%;
		position: absolute;
		top: 14%;
		left: 5%;
		box-sizing: border-box;
		border-radius: 15rpx;
		background-color: #ddd;
		overflow: hidden;
		color: #000;
	}

	.router-ul {
		width: 100%;
		height: 150rpx;
		background-color: #fff;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 15rpx;
		box-sizing: border-box;
	}

	.router-li {
		width: 160rpx;
		height: 120rpx;
		// background-color: #f0f;
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
	}

	.router-img {
		width: 60rpx;
		height: 60rpx;
		// background-color: #0ff;
	}

	.banner {
		width: 100%;
		height: 300rpx;
		// background-color: #2896ff;
		background-image: url('http://static.qlzc.net/1895408479469047808/material/30605e12-1551-4adb-9f2e-10281defaa32.png');
		background-size: 100% 100%;
		border-radius: 10rpx;
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
		margin-top: -5rpx;
		overflow: hidden;
		padding: 20rpx;
		box-sizing: border-box;
	}

	.banner2 {
		width: 100%;
		height: 200rpx;
		background-color: #2896ff;
		border-radius: 10rpx;
		box-sizing: border-box;
		display: flex;
		margin-top: 10rpx;
	}

	.banner-left {
		flex: 1;
		height: 100%;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}

	.baner-value {
		font-size: 1.5rem;
		font-weight: bolder;
		margin-bottom: 10rpx;
	}

	.baner-money {
		width: 100%;
		height: 160rpx;
		// background-color: #f50;
		display: flex;
		justify-content: space-between;
		align-items: center;


		.b-n-1,
		.b-n-2 {
			flex: 1;
			height: 100%;
			display: flex;
			justify-content: center;
			// align-items: center;
			flex-direction: column;
			color: #fff;
		}
	}

	.account-value {
		font-size: 1.8rem;
		margin-top: 10rpx;
	}

	.b-n-2 {
		align-items: flex-end;
	}

	.wal-btn {
		width: 180rpx;
		height: 70rpx;
		background-color: #fff;
		color: rgba(32, 97, 255, 1);
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.baner-income {
		width: 100%;
		flex: 1;
		// background-color: #000;
		display: flex;
	}
</style>